﻿using FFmpeg.AutoGen;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FFmpegWinui3.FFmpegSampleFolder
{
    public unsafe class DecodeAudio
    {

        void Decode(AVCodecContext* oc,AVPacket *packet,AVFrame* frame)
        {

        }


        void Init()
        {
            AVCodec* codec = null;
            AVCodecParserContext* parameters = null;
            int len, ret;

            AVPacket* packet = ffmpeg.av_packet_alloc();
            AVFrame* frame = ffmpeg.av_frame_alloc();

            codec = ffmpeg.avcodec_find_decoder(AVCodecID.AV_CODEC_ID_MP2);
            parameters = ffmpeg.av_parser_init((int)codec->id);
            var oc =ffmpeg.avcodec_alloc_context3(codec);
            ffmpeg.avcodec_open2(oc, codec, null);
            while (true)
            {
                //ffmpeg.av_parser_parse2(parameters,oc,&packet->data,&packet->size,)
            }
        }

    }
}
